<template>
    <div>
        <input type="text" v-model="data">
        <button @click="add">添加</button>
        <ul >
            <li v-for="(item,i) in list">{{ item }}</li>
        </ul>
    </div>
</template>

<script setup>
    import { ref } from 'vue'
    const list = ref(['html', 'css', 'js'])
    const data = ref('')
    const add = () => {
        list.value.push(data.value)
        data.value = ''
    }
</script>

<style lang="scss" scoped>

</style>